{% extends "base.html" %}

{% load emojificate i18n package_tags page_metadata_tags %}

{% block metadata %}
    {% page_metadata page_title=package.title|emojify|emojificate page_description=package.repo_description page_keywords=package.grid_set.all|join:',' og_image_url=package.get_opengraph_image_url %}
{% endblock metadata %}

{% block breadcrumb %}
    <div class="breadcrumb">
        <div class="container">
            <div class="row">
                <div class="col-xs-12">
                    <h2>
                        <a href="{% url 'packages' %}">{% translate "Packages" %}</a> ›› {{ package.title }}
                        <div class="pull-right">
                            <div class="btn btn-default">
                                <a href="{% url 'edit_package' package.slug %}"><span class="glyphicon glyphicon-pencil"></span></a>
                            </div>
                        </div>
                    </h2>
                </div>
            </div>
        </div>
    </div>
{% endblock breadcrumb %}

{% block body %}
    <div class="row">
        <div class="col-md-8 main">
            <h2>package_score:: {{ package_score.total_score }}</h2>

            <p>{{ package_score.message }}</p>

            <table class="table">
                <thead>
                    <tr>
                        <th>{% translate "Rule" %}</th>
                        <th>{% translate "Description" %}</th>
                        <th>{% translate "Score" %}</th>
                        <th>{% translate "Max Score" %}</th>
                        <th>{% translate "More Info" %}</th>
                    </tr>
                </thead>
                <tbody>
                    {% for breakdown in package_score.breakdown %}
                        <tr>
                            <td>{{ breakdown.rule }}</td>
                            <td>{{ breakdown.description }}</td>
                            <td>{{ breakdown.score }}</td>
                            <td>{{ breakdown.max_score }}</td>
                            <td>
                                <a href="{{ breakdown.documentation_url|default:"" }}">Details</a>
                            </td>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>

            <pre>package_score:: {{ package_score }}</pre>

        </div> <!-- end six column section -->

    </div>
{% endblock body %}

{% block javascript %}
    {{ block.super }}
    <script type="text/javascript" src="{{ STATIC_URL }}js/underscore.js"></script>
    <script type="text/javascript" src="{{ STATIC_URL }}js/gh3.js"></script>
{% endblock javascript %}
